/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
 * Description: cdc_ncm driver vendor hooks
 */

#ifdef CONFIG_VENDOR_CDC_NCM_HOOKS
#undef TRACE_SYSTEM
#define TRACE_SYSTEM cdc_ncm

#define TRACE_INCLUDE_PATH trace/hooks
#if !defined(_TRACE_HOOK_CDC_NCM_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HOOK_CDC_NCM_H
#include <linux/tracepoint.h>
#include "vendor_hooks.h"

struct usbnet;
struct sk_buff;
struct usb_host_interface;
struct urb;
struct net_device;
struct skb_data;
struct cdc_ncm_ctx;

DECLARE_HOOK(vendor_cdc_ncm_cp_netname,
	TP_PROTO(struct usbnet *dev),
	TP_ARGS(dev));

DECLARE_HOOK(vendor_cdc_ncm_update_drvflags,
	TP_PROTO(struct cdc_ncm_ctx *ctx),
	TP_ARGS(ctx));

DECLARE_HOOK(vendor_cdc_ncm_burst_mode_init,
	TP_PROTO(struct sk_buff **skb_ptr, unsigned int skb_in_len),
	TP_ARGS(skb_ptr, skb_in_len));

DECLARE_HOOK(vendor_cdc_ncm_rxrestore,
	TP_PROTO(struct usbnet *dev, struct cdc_ncm_ctx *ctx, struct sk_buff *skb_in,
		unsigned int len, unsigned int offset, struct sk_buff **skb_ptr, int *pkt_cnt),
	TP_ARGS(dev, ctx, skb_in, len, offset, skb_ptr, pkt_cnt));

DECLARE_HOOK(vendor_cdc_ncm_return_burst,
	TP_PROTO(struct usbnet *dev, struct sk_buff **skb_ptr, int pkt_cnt),
	TP_ARGS(dev, skb_ptr, pkt_cnt));

#endif
/* This part must be outside protection */
#include <trace/define_trace.h>

#else
#include <linux/tracepoint.h>
struct usbnet;
struct sk_buff;
struct usb_host_interface;
struct urb;
struct net_device;
struct skb_data;
struct cdc_ncm_ctx;

DECLARE_EVENT_NOP(vendor_cdc_ncm_cp_netname,
	TP_PROTO(struct usbnet *dev),
	TP_ARGS(dev));

DECLARE_EVENT_NOP(vendor_cdc_ncm_update_drvflags,
	TP_PROTO(struct cdc_ncm_ctx *ctx),
	TP_ARGS(ctx));

DECLARE_EVENT_NOP(vendor_cdc_ncm_burst_mode_init,
	TP_PROTO(struct sk_buff **skb_ptr, unsigned int skb_in_len),
	TP_ARGS(skb_ptr, skb_in_len));

DECLARE_EVENT_NOP(vendor_cdc_ncm_rxrestore,
	TP_PROTO(struct usbnet *dev, struct cdc_ncm_ctx *ctx, struct sk_buff *skb_in,
		unsigned int len, unsigned int offset, struct sk_buff **skb_ptr, int *pkt_cnt),
	TP_ARGS(dev, ctx, skb_in, len, offset, skb_ptr, pkt_cnt, ret));

DECLARE_EVENT_NOP(vendor_cdc_ncm_return_burst,
	TP_PROTO(struct usbnet *dev, struct sk_buff **skb_ptr, int pkt_cnt),
	TP_ARGS(dev, skb_ptr, pkt_cnt));

#endif /* CONFIG_VENDOR_CDC_NCM_HOOKS */

